home *** CD-ROM | disk | FTP | other *** search
-
- ~40WATCHKAT~07
- ~27Carrier Detect Monitor~07
- by Keith P. Graham
- July 4, 1987
-
- WATCHKAT is a program loader and monitor which can be
- used in a communications environment to detect loss of carrier
- and kill the currently running job. This is useful for Bulletin
- Board "Doors" and similar applications. It is similar in concept
- to the WATCHDOG programs which monitor carrier detect and reboot
- the system. WATCHKAT kills only the currently running program
- and does not cause the system to reboot.
-
- WATCHKAT is a loader program which will load and
- execute a .COM or .EXE file. It will not execute .BAT files and
- should not be used to execute a second COMMAND.COM. It is small,
- adding very little in the way of memory usage and is resident
- only while the application is running. WATCHKAT unloads itself
- from memory when it is completed. WATCHKAT restores all used
- memory and all interrupt vectors to their original values after
- killing a program and sets ERRORLEVEL return codes according to
- what action WATCHKAT had to take.
-
- WATCHKAT uses COM1, but instructions are included to
- modify the program for COM2 or COM3.
-
- WATCHKAT is invoked by the command:
-
- WAKA program.ext parm1 parm2 parm3 parm4 ... parmn
-
- WAKA.COM must be on the path or the current subdirectory.
- PROGRAM.EXT is the complete disk/path/filename and extension of
- the program to be executed. WATCHKAT is not like command.com,
- but must have, at the very least, the filename and the extension
- of the program to be executed. WATCHKAT does not search a path.
- It needs full file name. PARM1 - PARMn are the normal parameters
- that would be passed to the program you want WATCHKAT to
- execute. There is a feature to the program which makes BASIC a
- little touchy about parameters. Please follow the last parameter
- with a space so that BASIC can properly use the parameters. This
- appears to be unique to BASIC. It should be noted that BASIC is
- nasty about opening and closing COM ports so that normal
- precautions still apply about using BASIC for communications
- applications.
-
- When WATCHKAT begins it attempts to load the program
- specified on the command line. WATCHKAT takes over interrupt 8
- and checks CD on COM1 every 10 seconds. If carrier drops, it
- stops the currently executing program and issues the dos
- function 4Ch to kill the program. Control should then return to
- WATCHKAT which will reset all it can and exit back to DOS.
- (Actually WATCHKAT is doing much more, but this is the part that
- matters). Interrupt 4Ch cannot kill command.com so WATCHKAT will
- not receive control. If after 20 seconds CD is still down and
- WATCHKAT is still working, WATCHKAT gives up. It restores as
- much as it can and returns control to DOS. If WATCHKAT has been
- used to start up a second command processor, it is up to the
- command processor to get itself out of trouble at this point. I
- do not recommend using WATCHKAT to invoke a second command
- processor as it is possible to hang the system if CD drops.
-
- WATCHKAT returns error levels according to the results
- of executing a program. These are summarized here.
-
- ERRORLEVEL Meaning
-
- 0 Normal execution and return
- 8 Program not found, WATCHKAT failed
- on attempt to execute program.
- 9 Badly formed parameter line.
- 10 Program killed due to CD drop.
-
- In addition WATCHKAT will pass on any ERRORLEVELs set by the
- sub-process. If WATCHKAT is used to execute ARCVUE and ARCVUE
- returns error 10 then that will be expressed in the return
- ERRORLEVEL. This may create possible conflicts when it cannot be
- certain if an ERRORLEVEL is from WATCHKAT or the sub-process.
-
- WATCHKAT will return error levels as follows for termination
- types. If a job ends due to non-normal exit methods then
- WATCHKAT will return an ERRORLEVEL as follows:
-
- ERRORLEVEL Meaning
-
- 1 Ctrl-Break exit.
- 2 Critical DOS Error Exit.
- 3 Terminate and stay resident.
-
- WATCHKAT only monitors COM1. If you have a need to
- monitor another port then the program WAKA.COM can be modified
- using debug. The location of the COM port is at 104h in the .COM
- file. 0 is com1, 1 is com2, 2 is com3. I am not giving a
- detailed script on how to do this, because if you don't know how
- you shouldn't be doing it. Please do not distribute versions of
- WATCHKAT with the COM2 modification as I think that it would
- cause too much confusion.
-
- I am collecting ideas for improvements to the program.
- In a future version I will have either an install program or a
- command line switch to control com port. I would like to create
- a similar program which would also monitor time remaining for
- PC-Board and kill programs after time is up. Please let me know
- if you have any ideas.
-
- WATCHKAT is a free program. Please distribute it as
- WAKA100.ARC with all of the files included without modification.
- I have been testing WATCHKAT at PC Rockland for over a month and
- have not had any problems. It has been monitoring a PC Board
- Door called ARCVUE. If you have any problems or suggestions
- leave a message to me (Keith Graham) at PC-Rockland at (914)
- 353-2176.
-
- Thanks,
-
- Keith
-
-